//
//  WYConditionView.m
//  CirclePush
//
//  Created by admin on 2018/5/10.
//  Copyright © 2018年 admin. All rights reserved.
//

#import "WYConditionView.h"
#import "WYMdeiaCell.h"
@interface WYConditionView()


@end

@implementation WYConditionView
-(instancetype)init
{
    if (self = [super init]) {
        [self setupUI];
    }
    return self;
}
-(void)awakeFromNib
{
    [super awakeFromNib];
    [self setupUI];
   // self.collectionView.backgroundColor = [UIColor blackColor];
}
-(void)setupUI
{

    UICollectionViewFlowLayout *layout=[[UICollectionViewFlowLayout alloc]init];
    layout.itemSize=CGSizeMake((kScreenWidth-50)/4, 30);
    //横向最小距离
    layout.minimumInteritemSpacing=10.0f;
    layout.minimumLineSpacing=10.0f;
    //cell距离上  左  下 右 的距离
    layout.sectionInset=UIEdgeInsetsMake(10, 10, 10, 10);
    [layout setScrollDirection:UICollectionViewScrollDirectionHorizontal];
    
    //[layout setHeaderReferenceSize:CGSizeMake(kScreenWidth, 44)];
    
    self.collectionView = [[UICollectionView alloc]initWithFrame:CGRectMake(0, 0, kScreenWidth-50, 44) collectionViewLayout:layout];
    
    
    [self.collectionView setCollectionViewLayout:layout];
    [self addSubview:self.collectionView];
    
    [self.collectionView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.top.bottom.mas_equalTo(0);
        make.right.mas_equalTo(-50);
    }];
    
    self.resetButton = [[UIButton alloc]init];
    [self addSubview:self.resetButton];
    [self.resetButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.top.bottom.mas_equalTo(0);
        make.width.mas_equalTo(50);
    }];
    
    self.resetButton.backgroundColor = [UIColor whiteColor];
    [self.resetButton setTitle:@"重置" forState:UIControlStateNormal];
    [self.resetButton setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
//    self.collectionView.delegate =self;
//    self.collectionView.dataSource = self;

    UIView *lineView = [[UIView alloc]init];
    [self addSubview:lineView];
    [lineView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.bottom.mas_equalTo(0);
        make.height.mas_equalTo(kLineHeight);
    }];
    lineView.backgroundColor = [UIColor hexStringToColor:@"#e6e6e6" alpha:1.0];
    
    
    
    
}
@end
